var categoryName = $("input[name='categoryName']").val();
var title = $("input[name='title']").val();

$('title').text('广联官方网站 '+categoryName +" "+ title);

var api = "/api/news/topThreeList";
var data = {
    "category_name": categoryName,
}

postJSON(api, data, function (res) {
    console.log(res)
    var html = "";
    $(".recent-news ul").empty();
    $.each(res.data, function (index, item) {
        var curTime = new Date(item.modify_date).format("yyyy-MM-dd");
        if (vaildeParam(item.img)){
            html = $('<li>\n' +
                '                                <a href="/news/socialResponsibility?id=' + item.id + '" class="pic-box">\n' +
                '                                    <p class="cover"><img src="' + item.img + '">\n' +
                '                                    </p>\n' +
                '                                    <p class="title">' + item.title + '</p>\n' +
                '                                </a>\n' +
                '                                <p><a href="/newsActivities?title=' + item.category_name + '" class="btn-news-series font-gotham">' + item.category_name + '</a><span class="date">' + curTime + '</span></p>\n' +
                '                            </li>')
        }else {
            html = $('<li>\n' +
                '                                <a href="/news/socialResponsibility?id=' + item.id + '" class="pic-box">\n' +
                '                                    <p class="title">' + item.title + '</p>\n' +
                '                                </a>\n' +
                '                                <p><a href="/recruitmentAd" class="btn-news-series font-gotham">' + item.category_name + '</a><span class="date">' + curTime + '</span></p>\n' +
                '                            </li>')
        }


        $(".recent-news ul").append(html);

    });
})